package com.lxy.aimin.auth.proxy;

import com.lxy.aimin.auth.service.UserService;

import java.lang.reflect.Proxy;

public class ProxyFactory {


    public static <T> T creatProxy(Object target, Class<T> interfaces) {
        ClassLoader classLoader = target.getClass().getClassLoader();
        return (T)Proxy.newProxyInstance(classLoader,new Class[]{interfaces},new ProxyHandler(target));
    }
}
